package indigo.mybatis.pagination;

import org.apache.ibatis.session.RowBounds;

public class PagedRowBounds extends RowBounds {
	public PagedRowBounds(int pageIndex, int pageSize) {
		super(pageIndex * pageSize, pageSize);
	}

	public int getPageIndex() {
		return (int) Math.ceil((double) getOffset() / getLimit());
	}

	public int getPageSize() {
		return getLimit();
	}
}
